<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> 
  <title>详情</title>
  <!-- include jquery -->
  <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> 

  <!-- include libraries BS3 -->
  <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css" />
  <script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.0.1/js/bootstrap.min.js"></script>

  <!-- include summernote -->
  <link rel="stylesheet" href="__PUBLIC__/Admin/summernote-master/dist/summernote.css">
  <script type="text/javascript" src="__PUBLIC__/Admin/summernote-master/dist/summernote.js"></script>
  <script src="__PUBLIC__/Admin/summernote-master/dist/lang/summernote-zh-CN.js"></script>

  <script type="text/javascript">
   /* $(function() {
      $('.summernote').summernote({
        height: 200,
        minHeight: 200, 
        maxHeight: 300,
        focus: true,
        lang: 'zh-CN' // default: 'en-US'
      });

      $('form').on('submit', function (e) {
        e.preventDefault();
        alert($('.summernote').summernote('code')); //获取html内容
        alert($('.summernote').val());
      });
    });*/
  </script>
</head>
<body>
  <!-- 
<form action="#" novalidate>
<div class="form-group">
    <label for="contents">Contents</label>
    <textarea name="text"></textarea>
  </div> 
   <button type="submit" class="btn btn-default">submit</button>
</form>
 -->

 <style>
.bar-nav{
	    background: #FFF;
    	border-bottom: 1px solid #eee;
}
.bar{
    right: 0;
    left: 0;
    z-index: 10;
    height: 4.2rem;
    padding-right: .5rem;
    padding-left: .5rem;
    background-color: #f7f7f8;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
.title{
	position: absolute;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0 -.5rem;
    font-size: 1.85rem;
    font-weight: 500;
    line-height: 4.2rem;
    color: #3d4145;
    text-align: center;
    white-space: nowrap;
}
.bar-nav i.icon{
	position: relative;
    z-index: 20;
    line-height: 4.2rem;
    font-size: 2.5rem;
    font-family: serif;
    font-style: inherit;
    left: 10px;
}
</style>
		<div class="bar bar-nav">
			<h1 class="title">活动简介</h1>
			<i class="icon icon-back" onclick="window.history.go(-1);"><</i>
		</div> 
 <br/>
<!-- note-editable panel-body -->
<label for="contents">注：活动详情不得少于50个字数</label>
<div class="click2edit">{$describe|htmlspecialchars_decode}</div>

<button id="edit" class="btn btn-primary" onclick="edit()" type="button">修改</button>
<button id="save" class="btn btn-primary" onclick="save()" type="button">预览</button>

<form action="" method="post" id="form_default" style="float:left;margin-right:5px;">
	<input type="hidden" name="id" value="{$id}" />
	<input type="hidden" name="act" value="{$act}" />
	<input type="hidden" name="describe" value="" />
	<button id="alert_info" type="submit" class="btn btn-success">提交</button>
</form>
		
<script type="text/javascript">

$(function() {
  var makrup = '';
      $('.click2edit').summernote({
        height: 300,
        minHeight: 300, 
        maxHeight: 700,
        focus: true,
        lang: 'zh-CN' // default: 'en-US'
      });
    });

var edit = function() {
  $('.click2edit').summernote({focus: true,height: 300,});
};

var save = function() {
  //makrup = $('.click2edit').summernote('code');
  $('.click2edit').summernote('destroy');
};

$("#alert_info").click(function(){
  makrup = $('.click2edit').summernote('code');
  $("input[name='describe']").val(makrup);
  //alert(makrup.length);
});

$("#form_default").submit(function(){
	makrup = $('.click2edit').summernote('code');
	if(makrup.length < 50){
		alert('详情不得少于50个字数');
		return false;
	}
	$("input[name='describe']").val(makrup);
	
});
</script>
</body>
</html>


<!-- 多个编辑器

要在页面上显示多个编辑器，您需要<div>在HTML中放置两个以上的元素。

<div class="summernote">summernote 1</div>
<div class="summernote">summernote 2</div>
然后用jQuery选择器运行summernote。

$(document).ready(function() {
  $('.summernote').summernote();
}); -->